package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Aliasregionlist;
import com.ean.backpack.domain.AliasregionlistPK;
import com.ean.backpack.repository.AliasregionlistRepository;
import com.ean.backpack.service.AliasregionlistService;

@Service
@Transactional
public class AliasregionlistServiceImpl implements AliasregionlistService {

	@Autowired
	AliasregionlistRepository aliasregionlistRepository;

	public long countAllAliasregionlists() {
		return aliasregionlistRepository.count();
	}

	public void deleteAliasregionlist(Aliasregionlist aliasregionlist) {
		aliasregionlistRepository.delete(aliasregionlist);
	}

	public Aliasregionlist findAliasregionlist(AliasregionlistPK id) {
		return aliasregionlistRepository.findOne(id);
	}

	public List<Aliasregionlist> findAllAliasregionlists() {
		return aliasregionlistRepository.findAll();
	}

	public List<Aliasregionlist> findAliasregionlistEntries(int firstResult,
			int maxResults) {
		return aliasregionlistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveAliasregionlist(Aliasregionlist aliasregionlist) {
		aliasregionlistRepository.save(aliasregionlist);
	}

	public Aliasregionlist updateAliasregionlist(Aliasregionlist aliasregionlist) {
		return aliasregionlistRepository.save(aliasregionlist);
	}
}
